import { createSSRApp } from "vue"
import App from "./App.vue"
import store from "./store"
import { routeInterceptor, requestInterceptor, prototypeInterceptor } from "./interceptors"
import "virtual:uno.css"
import "@/style/index.scss"
// import "@/static/fonts/style.css"
import OptimizeRender from "./directives/optimizeRender"


import uviewPlus, { setConfig } from 'uview-plus'

export function createApp() {
  const app = createSSRApp(App)
  uni.$zp = {
    config: {
      //配置分页默认pageSize为15
      'default-page-size': 16,
      //配置空数据图默认描述文字为：空空如也~~
      'empty-view-text': '暂无数据',
    }
  }
  app.use(uviewPlus, () => {
		return {
			options: {
				// 修改$u.config对象的属性
				config: {
					// 修改默认单位为rpx，相当于执行 uni.$u.config.unit = 'rpx'
					unit: 'rpx'
				}
			}
		}
	})
  app.use(store)
  app.use(routeInterceptor)
  app.use(requestInterceptor)
  app.use(prototypeInterceptor)
  app.use(OptimizeRender)
  return {
    app,
  }
}
